<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="keywords" content="{:sysconfig('home','htitle')}" />
  <meta name="description" content="{:sysconfig('home','htitle')}" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>{:sysconfig('home','htitle')}</title>
	<link href="/style/style.css" rel="stylesheet" />
<link href="/style/dnf.css" rel="stylesheet" />
<link href="/style/main.css" rel="stylesheet" />
<link href="/style/xf.css" rel="stylesheet" />
	<script src="/qstatic/js/layui.js"></script>
	<link rel="stylesheet" href="/qstatic/js/css/layui.css" />
<script src="/qstatic/js/jquery.min.js"></script>

    
</head>
<body style="background-image: url(/images/qd-bg2.jpg);background-position: center 0;background-repeat: no-repeat;background-color: #f9f9f9;background-size: 100% 100%;">
<div style="margin-top: 0px;position: relative;">
	<img src="/images/tit1.png" style="margin: 0% 25%;width: 50%;"/>
	<ul style="width: 100%;margin: 24px auto 0;text-align: center;font-size: 0;">
		<li class="rsqdli">
			<div class="rsqdlidiv">
				<img class="rsdivimg" src="{$qd.0.img}" onmouseover='tipss(this,1)'>
			</div>
			<p class="rsqdvh">{$qd.0.name}</p>
			<button class="rsqdbut" onclick="qd(1,'{$qdlist.0.status}')" style="background: {$qdlist.0.color};border: 0px;padding: 3px 15px;">{$qdlist.0.status}</button>
		</li>
		<li class="rsqdli">
			<div class="rsqdlidiv">
				<img class="rsdivimg" src="{$qd.1.img}" onmouseover='tipss(this,2)'>
			</div>
			<p class="rsqdvh">{$qd.1.name}</p>
			<button class="rsqdbut" onclick="qd(2,'{$qdlist.1.status}')" style="background: {$qdlist.1.color};border: 0px;padding: 3px 15px;">{$qdlist.1.status}</button>
		</li>
		<li class="rsqdli">
			<div class="rsqdlidiv">
				<img class="rsdivimg" src="{$qd.2.img}" onmouseover='tipss(this,3)'>
			</div>
			<p class="rsqdvh">{$qd.2.name}</p>
			<button class="rsqdbut" onclick="qd(3,'{$qdlist.2.status}')" style="background: {$qdlist.2.color};border: 0px;padding: 3px 15px;">{$qdlist.2.status}</button>
		</li>
		<li class="rsqdli">
			<div class="rsqdlidiv">
				<img class="rsdivimg" src="{$qd.3.img}" onmouseover='tipss(this,4)'>
			</div>
			<p class="rsqdvh">{$qd.3.name}</p>
			<button class="rsqdbut" onclick="qd(4,'{$qdlist.3.status}')" style="background: {$qdlist.3.color};border: 0px;padding: 3px 15px;">{$qdlist.3.status}</button>
		</li>
		<li class="rsqdli">
			<div class="rsqdlidiv">
				<img class="rsdivimg" src="{$qd.4.img}" onmouseover='tipss(this,5)'>
			</div>
			<p class="rsqdvh">{$qd.4.name}</p>
			<button class="rsqdbut" onclick="qd(5,'{$qdlist.4.status}')" style="background: {$qdlist.4.color};border: 0px;padding: 3px 15px;">{$qdlist.4.status}</button>
		</li>
		<li class="rsqdli">
			<div class="rsqdlidiv">
				<img class="rsdivimg" src="{$qd.5.img}" onmouseover='tipss(this,6)'>
			</div>
			<p class="rsqdvh">{$qd.5.name}</p>
			<button class="rsqdbut" onclick="qd(6,'{$qdlist.5.status}')" style="background: {$qdlist.5.color};border: 0px;padding: 3px 15px;">{$qdlist.5.status}</button>
		</li>
		<li class="rsqdli">
			<div class="rsqdlidiv">
				<img class="rsdivimg" src="{$qd.6.img}" onmouseover='tipss(this,7)'>
			</div>
			<p class="rsqdvh">{$qd.6.name}</p>
			<button class="rsqdbut" onclick="qd(7,'{$qdlist.6.status}')"  style="background: {$qdlist.6.color};border: 0px;padding: 3px 15px;">{$qdlist.6.status}</button>
		</li>
		
	</ul>
</div>
<script>
    function tipss(element,id){
       if(id == 1){
           var info = '<?php echo str_replace(array("\r\n", "\n", "\r"), "<br>",$qd[0]["info"]); ?>';
       }else if(id == 2){
           var info = '<?php echo str_replace(array("\r\n", "\n", "\r"), "<br>",$qd[1]["info"]); ?>';
       }else if(id == 3){
           var info = '<?php echo str_replace(array("\r\n", "\n", "\r"), "<br>",$qd[2]["info"]); ?>';
       }else if(id == 4){
           var info = '<?php echo str_replace(array("\r\n", "\n", "\r"), "<br>",$qd[3]["info"]); ?>';
       }else if(id == 5){
           var info = '<?php echo str_replace(array("\r\n", "\n", "\r"), "<br>",$qd[4]["info"]); ?>';
       }else if(id == 6){
           var info = '<?php echo str_replace(array("\r\n", "\n", "\r"), "<br>",$qd[5]["info"]); ?>';
       }else if(id == 7){
           var info = '<?php echo str_replace(array("\r\n", "\n", "\r"), "<br>",$qd[6]["info"]); ?>';
       }
        layer.tips(info, element);
    }
    function qd(id,status){
        if(status != "签到"){
            layer.msg('该时间不可签到');
            return false;
        }
        var load = layer.load(1);
        var options = "";
        //选择角色
        $.post("/home/getnoidlist", function(data){
            console.log(data);
            if(data.code == "0"){
                layer.msg(data.msg);
                layer.close(load);
                return false;
            }
            // 根据返回的JSON数据生成选择框的选项
            $.each(data.data, function(key, value){
                options += "<option value='" + value.charac_no + "'>" + value.charac_name + "</option>";
            });
            layer.close(load);
            // 打开选择框弹层
            layer.open({
                type: 1,
                title: '请选择角色',
                content: '<div style="padding:20px;"><select id="choice" class="layui-input">' + options + '</select></div>',
                btn: ['确定', '取消'],
                yes: function(index, layero){
                    // 点击确定按钮时执行的回调函数
                    var selectedValue = $("#choice").val();
                    var selectedText = $("#choice option:selected").text();
                    //layer.msg('你选择了 ID：' + selectedValue + '，内容：' + selectedText);
                    //开始签到
                    var load = layer.load(1);
                    $.post("/home/sign",
                    {
                      id:id,
                      noid:selectedValue,
                      name:selectedText,
                    },
                    function(data,status){
                		if(data.code==1){
                		    layer.close(load);
                		    layer.msg(data.msg)
                		    setTimeout(function(){window.location.reload()}, 2000);
                		}else{
                		    layer.close(load);
                		    layer.msg(data.msg)
                		}
                    });
                    
                    
                    layer.close(index); 
                },
                btn2: function(index, layero){
                    // 点击取消按钮时执行的回调函数
                    // 可以在这里进行取消操作，比如清除已选择的内容
                }
            });
        });
        

    }
</script>
</body>